//
//  QLMBottomDetailTVCell.m
//  Xiaomakuaixiu
//
//  Created by 龚碧容 on 2017/10/11.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "QLMBottomDetailTVCell.h"

@implementation QLMBottomDetailTVCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(CGFloat)autoChangeHeightWithLabel:(Vertical *)textLabel{
    CGSize constraint = CGSizeMake(kScreen_width-90-20,CGFLOAT_MAX);
    CGRect size = [textLabel.text boundingRectWithSize:constraint
                                               options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingTruncatesLastVisibleLine)
                                            attributes:@{NSFontAttributeName:textLabel.font}
                                               context:nil];
    
    CGFloat textHeight = size.size.height;
    return textHeight;
}

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *identifiew=@"QLMBottomDetailTVCellId";
    QLMBottomDetailTVCell *cell=[tableView dequeueReusableCellWithIdentifier:identifiew];
    if (cell==nil) {
        cell=[[[NSBundle mainBundle] loadNibNamed:@"QLMBottomDetailTVCell" owner:nil options:nil] firstObject];

        cell.decriptionLa.font = [UIFont systemFontOfSize:16];
        cell.decriptionLa.verticalAlignment=VerticalAlignmentTop;
    }
    return cell;
}
@end
